using System;
using System.Collections.Generic;
using System.Text;
using Bifrost;

namespace TextEditor
{
    public class A_InsertLisCheckoutAndCheck : A_Action
    {
        public override string ActionName()
        {
            return "insertlischeckoutandcheck";
        }

        public override bool UIExecute()
        {
            if (base.myOwnerDocument.Us.InpatientInfo != null)
            {
                //App.ShowLisResault(base.OwnerDocument.Us.InpatientInfo.PId);
                //Bifrost.HisInstance.FrmLis fc = new Bifrost.HisInstance.FrmLis(base.OwnerDocument.Us.InpatientInfo.PId);
                //fc.GetListValue += new EventHandler(insert_list);
                //fc.Show();
            }
            return true;
        }

        public void insert_list(object sender, EventArgs e)
        {
            if (App.LisResault.Trim() != "")
            {
                base.OwnerDocument._InsertString(App.LisResault.Replace("\r\n", "\r"));
            }
        }

        public override bool isEnable()
        {
            return base.myOwnerDocument.CanModify() && base.myOwnerDocument.Us.InpatientInfo != null;
        }
    }
}
